package com.bank.filter;

/**
 * Created by Administrator on 2016/5/17.
 */

import javax.servlet.*;
import java.io.IOException;
import java.text.DecimalFormat;
import java.text.NumberFormat;

public class TimerFilter implements Filter {
   
    public static final NumberFormat FORMAT = new DecimalFormat("0.000");

    @Override
    public void destroy() {

    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response,
                         FilterChain chain) throws IOException, ServletException {
        long begin = System.currentTimeMillis();

        try {
            chain.doFilter(request, response);
        } catch (Exception e) {
           
            e.printStackTrace();
            //response = (HttpServletResponse) response;

            //((HttpServletResponse) response).setStatus(500);
            //throw e;
//            ((HttpServletResponse) response).sendRedirect("/index.do");
        }


       
    }

    @Override
    public void init(FilterConfig arg0) throws ServletException {

    }

}
